~include file="header.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
<title>公开分享 - ~$tit~~</title>~include file="head.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
<style type="text/css">
</style>
<div class="container">
    <div class="well bs-component">
        <h1>公开分享</h1>
        <div class="table-responsive">
        <table class="table table-striped table-hover ">
            <thead>
                <tr>
                    <th>
                        <input type="checkbox" onclick="selectAll(this);" />
                    </th>
                    <th>分享文件名</th>
                    <th>源文件名</th>
                    <th>下载次数</th>
                    <th>分享日期</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>~section loop=$filedata name=two~~
                <tr>
                    <td>
                        <input type="checkbox" name="file" value="~$filedata[two].sskey~~" />
                        </th>
                    </td>
                    <td>~$filedata[two].fname~~.~$filedata[two].ftype~~</td>
                    <td><a target="_blank" href="~$zzurl~~/views/fileJump.php?key=~$filedata[two].filekey~~&ming=~$filedata[two].ming~~">~$filedata[two].ming~~</a>
                    </td>
                    <td>~$filedata[two].downloadnum~~</td>
                    <td>~$filedata[two].sstime~~</td>
                    <td><a href="#" onclick="delshare('~$filedata[two].sskey~~');">删除</a>  <a href="../f.php?k=~$filedata[two].sskey~~" target="_blank">查看</a>
                    </td>
                    </td>~sectionelse~~ ~/section~~</tbody>
        </table></div> <a href="javascript:void(0)" onclick="delall();" id="s" class="btn btn-raised btn-danger"><i class="fa fa-remove" aria-hidden="true"></i> 删除选中文件</a>
    </div>~include file="footer.html" titm = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
    <script type="text/javascript" src="~$zzurl~~content/themes/material/js/ZeroClipboard.js"></script>
    <script language="JavaScript">
        function delall() {
            var chk_value = []; //定义一个数组    
            $('input[name="file"]:checked').each(function() {
                chk_value.push($(this).val());
            });
            $("#s").attr("disabled", "true");
            for (key1 in chk_value) {
                $.ajax({
                    type: "POST",
                    url: "../includes/userAction.php",
                    data: {
                        key: chk_value[key1],
                        action: "delshare"
                    },
                    dataType: "text",
                    async: false,
                    success: function(data) {
                        var pe = data.split(".");
                        if (pe[0] == "ok") {} else {
                            $.snackbar({
                                content: "删除时遇到错误",
                                timeout: 2000
                            });
                        };
                    }
                });
            }
            $("#ss").removeAttr("disabled");
            window.location.reload();
        }

        function delshare(key1) {
            $.post("../includes/userAction.php", {
                key: key1,
                action: "delshare"
            }, function(data) {
                var pe = data.split(".");
                if (pe[0] == "ok") {
                    $.snackbar({
                        content: pe[1],
                        timeout: 2000
                    });
                    setTimeout(function() {
                        window.location.reload();
                    }, 2000);
                } else {
                    $.snackbar({
                        content: pe[1],
                        timeout: 2000
                    });
                };
            });
        }

        function selectAll(checkbox) {
            $('input[type=checkbox]').prop('checked', $(checkbox).prop('checked'));
        }
    </script>
    </script>